<h1>Listing pages</h1>

<table class="pages">
<% for page in @pages %>
  <tr>
    <td><%= page.url %></td>
    <td><%= link_to 'Show', :action => 'show', :id => page %></td>
    <td><%= link_to 'Edit', :action => 'edit', :id => page %></td>
    <td><%= link_to 'Destroy', { :action => 'destroy', :id => page }, :confirm => 'Are you sure?', :method => :post %></td>
  </tr>
<% end %>
</table>

<%= link_to 'Previous page', { :page => @page_pages.current.previous } if @page_pages.current.previous %>
<%= link_to 'Next page', { :page => @page_pages.current.next } if @page_pages.current.next %> 

<p>
  <%= link_to 'New page', :action => 'new' %>
</p>
